package top.laoshuzi.designpatterns.base.created.singleton;

/**
 * 静态内部类
 */
public class Singleton4 {

    private String name = "静态内部类";

    public static Singleton4 getInstance() {
        return SingletonInstance.INSTANCE;
    }

    private Singleton4() {
    }

    public String getName() {
        return name;
    }

    private static class SingletonInstance {
        private static final Singleton4 INSTANCE = new Singleton4();
    }

}
